package client.ui.panel;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class BasicInfoPanel extends JPanel {
	
	private JPanel infoContainer;
	private JLabel name;
	private JLabel[] info;
	private JButton logout;
	private JPanel bb;
	private DefaultPanel dp;
	private URL bye = getClass().getResource("door_out.png");
	public ImageIcon out=new ImageIcon(bye);
	public BasicInfoPanel(){
		
		dp=new DefaultPanel();
		setLayout(new BorderLayout());
		setBackground(Color.BLUE);
		
		logout=new JButton("EXIT",out);
		logout.addActionListener(new LogoutListener());
		name=new JLabel(/** Should probably use instancce of method. User.getUsername */);
		infoContainer=new JPanel();
		bb=dp.getButton();
		add(logout,BorderLayout.NORTH);
		add(infoContainer,BorderLayout.SOUTH);
		add(bb,BorderLayout.CENTER);
		
	}
	public class LogoutListener implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent e) {
			if(e.getSource()==logout){
				System.exit(0);
			}
			
		}
		
	}

}
